#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;

int n, m, l, x, y, z;
const int maxn = 1000000+7;
double a[maxn], b[maxn], c[maxn];

# if 0
using namespace std;
double sum[maxn];
double solve(double a[], int N, int L){
    static int b[maxn];
    memset(b, 0, sizeof(b));
    memset(sum, 0, sizeof(sum));
    double eps = 1e-5;
    double l = -1e6, r = 1e6;
    while(r - l > eps){
        double mid = (l + r) / 2;
        for (int i = 1; i <= N; i++) b[i] = a[i] - mid;
        for (int i = 1; i <= N; i++)
            sum[i] = (sum[i - 1] + b[i]);
        double ans = -1e10;
        double min_val = 1e10;
        for (int i = L; i <= N; i++) {
            min_val = min(min_val, sum[i - L]);
            ans = max(ans, sum[i] - min_val);
        }
        if (ans >= 0) l = mid; else r = mid;
    }
    cout << l <<' '<< r << endl;
    return r;
}


#else
int n, m, l, x, y, z;
double a[maxn], b[maxn], c[maxn];


double solve(double a[], int n, int f){
  double l,s,mid;
  double d[maxn];
  double sum[maxn];
	memset(d,0,sizeof(d));//记录平均数的差值；
	memset(sum,0,sizeof(sum));
	l = 0; s = maxn;mid = 0 ;
	cin >> n >> f;
	for(int i = 1 ; i<= n ; ++i){
		cin >> a[i];
		l = max(l,a[i]);
		s = min(s,a[i]);
		//sum[i] = sum[i-1] + a[i];//计算前缀和
	}

	while(l-s > 1e-4){
		mid = (l+s)/2;//是否为double？
		for(int i = 1 ; i <=n ;++i){
			d[i] = a[i] -mid;//计算差值
		}
		double max_sub_d = -1e9; double min_sub_d = 1e9;
		for(int i =1 ; i <= n ;++i){
			sum[i] = sum[i-1] +d[i];//与平均值的差值比较mid取得是否合适
		}
		for(int i = f ; i <= n;++i){
			min_sub_d = min(min_sub_d,sum[i-f]);
			max_sub_d = max(max_sub_d,sum[i]-min_sub_d);//算出最大k项至n中 最大的几项
		}
		if(max_sub_d >= 0) { //如果当前的平均值普遍偏大则扩大左极限范围
			s = mid ;
		}
		else {//否则就缩小右极限
			l = mid; //平均值是个基准数
		}

	}

	cout << l <<endl;
  return l;
}

#endif
int main() {
  int T; scanf("%d", &T);
  while(T--) {
    scanf("%d%d%d", &n, &m, &l);
    scanf("%d%d%d", &x, &y, &z);
    for(int i=1; i<=n; ++i) scanf("%lf", a+i);
    for(int i=1; i<=m; ++i) scanf("%lf", b+i);
    for(int i=1; i<=l; ++i) scanf("%lf", c+i);
    cout<<"????\n";
    solve(a, n, x);
    solve(b, m, y);
    solve(c, l, z);
  }
}
